package Main;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import Data.ConnectToDataBase;
import Model.Classe;
import Model.EmploiDuTemps;
import Model.Module;
import Model.Professor;
import Model.Professors;
import Model.Promotion;
import Model.Promotions;
import Model.Sceance;
import Service.ServiceEmploi;

public class Test {
	public static void main(String[] args) throws ParseException {
		ConnectToDataBase p = new ConnectToDataBase();
		EmploiDuTemps emploi = new EmploiDuTemps();
		List<Sceance> listSceance = new ArrayList<Sceance>();
		List<Module> listModule = new ArrayList<Module>();
		List<Classe> listClasse = new ArrayList<Classe>();
		HashMap<String,Module> hm = new HashMap<String,Module>();
		Professor professor = new Professor();
		Professors professors = new Professors();
		Promotions promotions = new Promotions();
		SimpleDateFormat formatterDate = new SimpleDateFormat("yy-MM-dd");
		SimpleDateFormat formatterTime = new SimpleDateFormat("HH:mm:ss");
		Promotion promotion = new Promotion();
		Module module = new Module();
		Classe classe = new Classe();
		module.setName("UNIX");
		module.setId("UNIX");
		Sceance sceance = new Sceance();
		sceance.setId("SC6");
		sceance.setIdEmploi("M1");
		sceance.setModule(module);
		sceance.setDate(formatterDate.parse("2013-04-02"));
		sceance.setTime(formatterTime.parse("14:00:00"));
		ServiceEmploi service = new ServiceEmploi();
		boolean bol = service.logginUser("nbtuan", "");
		// sceance = service.findSceanceById("SC1");//=>> OK
		// emploi = service.findEmploiById("M1");
		// module = service.findModuleById("UNIX");
		// classe = service.findClasseById("M1");
		// promotion = service.findPromotionById("P17");
		// emploi = service.findEmploiByClasse("M1");
		// listSceance = service.findSceanceByEmploi("M1");
		// listModule = service.findModuleByProfessor("PR1");
		// listClasse = service.findClasseByPromotion("P16");
		// professor = service.findProfessorById("PR1");
		// professors = service.findAllProfessor();
		// promotions = service.findAllPromotion();
		//emploi = service.findEmploiByPromotionAndClasse("Promotion 16", "RSC");
		//listModule = service.findModuleByClasseAndPromotion("Promotion 17", "Master 1");
		//List<String> allName = new ArrayList<String>();
		//allName = service.findNameOfAllPromotion();
		//allName = service.findNameOfAllClasse();
		//listModule = service.findAllNameModule();
		listSceance = service.findAllSceance();
		// Open_ConnectDB();
		/*
		 * Connection conn = null; conn = p.Open_ConnectDB(); listSceance =
		 * (List<Sceance>) service.findAllSceanceOfClasse("Master 1",
		 * "Promotion 17"); //service.addSceance(sceance);
		 * p.Close_ConnectDB(conn);
		 */

	}

}
